package com.forest.core.etx

import android.widget.EditText
import com.forest.core.util.RegularUtil

fun EditText.isPhoneNumber(): Boolean {
    return RegularUtil.isPhoneNumber(text.toString())
}

fun EditText.isPassword(minLength: Int = 6, maxLength: Int = 16): Boolean {
    return RegularUtil.isPassword(text.toString()) && text.length >= minLength && text.length <= maxLength
}

fun EditText.isVerify(): Boolean {
    return RegularUtil.isVerify(text.toString())
}

fun EditText.toTrim(): String{
    return text.toString().trim()
}